package org.zhadoop.stream.cql.semanticanalyzer.analyzecontext;

import java.util.List;

import org.zhadoop.stream.api.streams.Schema;
import org.zhadoop.stream.cql.exception.SemanticAnalyzerException;
import org.zhadoop.stream.cql.semanticanalyzer.parser.context.ParseContext;

import com.google.common.base.Joiner;
import com.google.common.collect.Lists;

/**
 * select 子句语义解析内容
 * @author zwd
 *
 */
public class SelectClauseAnalyzeContext extends ExpressionsAnalyzeContext{

	/**
	 * select 中解析好的Schema 信息
	 */
	private Schema outputSchema;
	
	/**
	 * 是否包含distinct,
	 * 即是否以distinct开头
	 */
	private boolean isDistinct = false;
	
	
	@Override
	public void setParseContext(ParseContext parseContext) {
		
	}

	@Override
	public void validateParseContext() throws SemanticAnalyzerException {
		
	}

	@Override
	public List<Schema> getCreatedSchemas() {
		return Lists.newArrayList();
	}

	@Override
	public String toString() {
//		if (isDistinct)
//        {
//            return "DISTINCT " + Joiner.on(", ").join(getExpdes());
//        }
//        else
//        {
//            return Joiner.on(", ").join(getExpdes());
//        }
		return "";
	}

	public Schema getOutputSchema() {
		return outputSchema;
	}

	public void setOutputSchema(Schema outputSchema) {
		this.outputSchema = outputSchema;
	}

	public boolean isDistinct() {
		return isDistinct;
	}

	public void setDistinct(boolean isDistinct) {
		this.isDistinct = isDistinct;
	}
	
}
